﻿using LaserTag.Infrastructure;
using LaserTag.Module.Vision.ViewModels;
using Microsoft.Practices.Composite.Regions;

namespace LaserTag.Module.Vision.Controllers
{
    public class VisionSetupController
    {
        private readonly IRegionManager m_regionManager;
        private readonly IVisionSetupViewModel m_visionSetupViewModel;

        public VisionSetupController(IRegionManager regionManager, IVisionSetupViewModel visionSetupViewModel)
        {
            m_visionSetupViewModel = visionSetupViewModel;
            m_regionManager = regionManager;
        }

        public void Run()
        {
            var mainRegion = m_regionManager.Regions[RegionNames.MainRegion];

            mainRegion.Add(m_visionSetupViewModel.View);
            mainRegion.Activate(m_visionSetupViewModel.View);
        }
    }
}
